package cn.qn.repository.article;

import cn.qn.moudle.article.ArticlePraise;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Auther: Bryant
 * @Date: 2019/5/29
 * @Description:
 */
@Repository
public interface ArticlePraiseRepository extends JpaRepository<ArticlePraise, Integer> {

    /**
     * 查询文章获得的点赞信息
     *
     * @param articleId
     * @return
     */
    List<ArticlePraise> findByArticleId(String articleId);


    /**
     * 查询用户的点赞信息
     *
     * @param userId
     * @return
     */
    List<ArticlePraise> findByUserId(String userId);

    ArticlePraise findByArticleIdAndUserId(String articleId, String userId);

}
